import request from "../utils/request";


export const getAllDepartmentService = () => {
    return request.get("/department/getAllDepartment")
}

export const addDepartmentService = (department) => {
    const params = new URLSearchParams()
    params.append('department', department)
    return request.post("/department/addDepartment", params)
}

export const deleteDepartmentService = (id) => {
    const params = new URLSearchParams()
    params.append('id', id)
    return request.put("/department/deleteDepartment", params)
}

export const updateDepartmentService = (id,department) => {
    const params = new URLSearchParams()
    params.append('id', id)
    params.append('department', department)
    return request.post("/department/updateDepartment", params)
}